<?php
require_once "ModelBase.php";

class City extends TTEvent_Table_Abstract
{
	protected $_name = 'cities';
	protected $_primary = 'cid';
	
	public function getAllCity($nid){
		$nid = (int)$nid;
		$sql = "SELECT * FROM cities WHERE nid=".$nid;
		return $this->execSelectQuery($sql);
	}
	
	public function getDistrictByCity($cid)
    {
        $db = $this->getSlaveDB();
        $sql = 'SELECT * FROM districts WHERE cid = ?';
        return $db->fetchAll($sql, $cid);   
    }
}

